/**
 * syntaxhighlight2fckeditor.
 * Copyright (C) 2008-2010 Ranfow Tsang(ranfow@gmail.com).
 * http://code.google.com/p/syntaxhighlight2fckeditor/
 * 
 * This file is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General 
 * Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) 
 * any later version.
 *
 * You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to 
 * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 
 */

(function($){
    $(document).ready(function(){
        $("#btnInsert").click(function(){
            codes = $(".codes").val();
            langtype = $("#langtype").val();
            tagtype = $("#tagtype").val();
            if (tagtype == "textarea") {
                toAppend = '<br/><textarea name="code" cols="60" rows="10" class="' + langtype + '">' + codes + '</textarea>';
            } else {
                toAppend = '<br/><pre name="code" class="' + langtype + '">' + codes + '</pre>';
            }
            var oEditor = window.opener.FCK;
            oEditor.InsertHtml(toAppend);
            window.close();
        });
    });
})(jQuery);
